<?php
/**
 * Generate Attachements File and Make it 
 * donwloadable
 * 
 * @author Xavier VILAIN
 * @package Orx\Mailer
 * 
 */
use Orx\Mailer\MailBox\Message\Attachement;
$xview = Xview::instance();

$inlineId = $xview->val('inlineid');

try {
	$attachement = Fox\Dao::load(Attachement::className(), $inlineId);
	$attachement->download();
} catch(Fox\Object\Exception\NotExist $e) {
	Fox\Message::Error($e);
	$xview->redirectBack();
	
}
catch(Exception $e) {
	Fox\Message::Error($e);
	$xview->redirectBack();
	
}
echo $xview->messages();
exit;